package com.magic.smartcity.model.network;

import com.magic.smartcity.beans.BalanceBean;
import com.magic.smartcity.beans.FeedbackBean;
import com.magic.smartcity.beans.pojo.FeedbackBody;
import com.magic.smartcity.beans.pojo.LoginPojo;
import com.magic.smartcity.beans.RegisterBean;
import com.magic.smartcity.beans.RegisterBody;
import com.magic.smartcity.beans.TokenBean;
import com.magic.smartcity.beans.UserBean;
import com.magic.smartcity.beans.pojo.MsgCodePojo;
import com.magic.smartcity.beans.pojo.ResultData;
import com.magic.smartcity.beans.pojo.ResultList;
import com.magic.smartcity.beans.pojo.UpdatePasswordPojo;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface UserService {

    @GET("/prod-api/api/common/user/getInfo")
    Observable<UserBean> getUser();

    @POST("/prod-api/api/login")
    Observable<TokenBean> loginUser(@Body LoginPojo user);

    @POST("/prod-api/api/register")
    Observable<RegisterBean> register(@Body RegisterBody user);

    @PUT("/prod-api/api/common/user")
    Observable<RegisterBean> updateUser( @Body UserBean.UserBeanDo userBeanDo);

    @PUT("/prod-api/api/common/user/resetPwd")
    Observable<MsgCodePojo> updatePassword(@Body UpdatePasswordPojo updatePasswordPojo);

    @GET("/prod-api/api/common/feedback/list")
    Observable<ResultList<FeedbackBean>> getFeedbackList();

    @GET("/prod-api/api/common/feedback/{id}")
    Observable<ResultData<FeedbackBean>> getFeedbackById(@Path("id") int id);

    @POST("/prod-api/api/common/feedback")
    Observable<ResultData> submitFeedback(@Body FeedbackBody bean);

    @GET("/prod-api/api/common/balance/list")
    Observable<ResultList<BalanceBean>> getBalanceList();

    @POST("/prod-api/api/common/balance/recharge")
    Observable<ResultData<BalanceBean>> balanceRecharge(@Query("money") long money);
}
